<template>
  <div>
    <div class="w-100 flexLeft echarts-head-1">10天订单占比</div>
    <div id="min" class="Tmok"></div>
  </div>
</template>
<script>
import * as echarts from "echarts";

export default {
  data() {
    return {};
  },
  mounted() {
    this.msst();
  },
  methods: {
    msst() {
      // 基于准备好的dom，初始化echarts实例
      var myhomt = echarts.init(document.getElementById("min"));
      // 绘制图表
      myhomt.setOption({
        title: {
          text: "订单百分比",
          padding: [15, 30],
          textStyle: {
            fontSize: 14,
            fontWeight: "100",
          },
        },
        toolbox: {
          right: 20,
          top: 5,
          feature: { saveAsImage: { type: "png" } },
        },
        tooltip: {},
        legend: {},
        series: [
          {
            name: "Access From",
            type: "pie",
            radius: "50%",
            data: [
              { value: 735, name: "Direct" },
              { value: 580, name: "Email" },
              { value: 484, name: "Union Ads" },
              { value: 300, name: "Video Ads" },
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
          },
        ],
      });
      window.addEventListener("resize", function () {
        myhomt.resize();
      });
    },
  },
};
</script>
<style scoped>
.echarts-head-1 {
  border-bottom: 1px solid #ebeef5;
  height: 49px;
  padding-left: 15px;
  font-size: 15px;
}

.Tmok {
  height: 350px;
  width: 100%;
}
</style>
